﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OpenList.aspx.cs" Inherits="famails.BackEnd.page.OpenList" %>

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="../../Images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <title>Danh sách email đã mở</title>
    <link href="../../font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href="../../Content/bootstrap.css" rel="stylesheet" />
    <link href="../../css/dataTables.bootstrap.css" rel="stylesheet" />
</head>
<body>
    <div class="panel-body" style="margin: 10px; width: auto;">
        <center>
                                <div id="btnExportExcel" onclick="tableToExcel('dataTables-example')" style="background: none; width:150px;color: #333; text-align: center; padding: 6px 15px; border-radius: 0px; border: 2px solid #333;" class="btn">
                                    <span style="margin-right: 10px;color:#333;" class="fa fa-mail-forward"></span>Xuất dữ liệu
                                </div>
                            </center>

        <div class="table-responsive" style="border: 0px; margin-top: 10px;">
            <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                <thead>
                    <tr>
                        <th>Họ tên</th>
                        <th>Email</th>
                        <th>Ngày sinh</th>
                        <th style="width:70px;">Giới tính</th>
                        <th style="width:95px;">Số điện thoại</th>
                        <th>Địa chỉ</th>
                        <th style="width:180px;">Nghề nghiệp</th>
                        <th>Công ty</th>
                        <th style="width:200px;">Thời gian mở</th>
                    </tr>
                </thead>
                <tbody>
                    <asp:Repeater runat="server" ID='rptOpenList'>
                        <ItemTemplate>
                            <tr>
                                <td style="vertical-align:middle;"><%#Eval("Name") %></td>
                                <td style="vertical-align:middle;"><%#Eval("OpenEmail") %></td>
                                <td style="vertical-align:middle;"><%#(Eval("Birthday")+""!=""?Convert.ToDateTime(Eval("Birthday")).ToString("dd/MM/yyyy"):"") %></td>
                                <td style="vertical-align:middle;"><%#Eval("Gender") %></td>
                                <td style="vertical-align:middle;"><%#Eval("Phone") %></td>
                                <td style="vertical-align:middle;"><%#Eval("Address") %></td>
                                <td style="vertical-align:middle;"><%#Eval("Job") %></td>
                                <td style="vertical-align:middle;"><%#Eval("Company") %></td>
                                <td style="vertical-align:middle;"><%#Eval("OpenDate") %></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </tbody>
            </table>
        </div>
        <!-- /.table-responsive -->
    </div>
    <!-- /#wrapper -->
    <script type="text/javascript" src="../../js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../Scripts/bootstrap.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.dataTables.js"></script>
    <script type="text/javascript" src="../../Scripts/dataTables.bootstrap.js"></script>
    <script>
        jQuery(function () {
            $('#dataTables-example').dataTable({
                "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]/*,
                "dom": 'T&lt;"clear"&gt;lfrtip',
                "tableTools": {
                    "sSwfPath": "../resource/TableTools/media/swf/ZeroClipboard.swf"
                }*/
            });
        });
    </script>

    <script>
        var tableToExcel = (function () {
            var uri = 'data:application/vnd.ms-excel;base64,'
              , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
              , base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) }
              , format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) }
            return function (table, name) {
                if (!table.nodeType) table = document.getElementById(table)
                var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML }
                window.location.href = uri + base64(format(template, ctx))
            }
        })()
    </script>

</body>

</html>

